<!doctype html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<title>Jk-注册中心</title>
		<meta name="keywords" content="某某科技" />
		<meta name="description" content="某某科技" />
		
		
		<!-- 引入bootstrap的css -->
		<link  href="Js/js/bootstrap/css/bootstrap.min.css" rel="stylesheet" >
		<!-- 引入bootstrap-treeview的css -->
		<link  href="Js/js/treeview/bootstrap-treeview.min.css" rel="stylesheet" >
		<!-- 引入bootstrap-addTabs的css -->
		<link  href="Js/js/addTabs/addTabs.css" rel="stylesheet" >
		<!-- 引入bootstrap-table的css -->
		<link  href="Js/js/table/bootstrap-table.min.css" rel="stylesheet" >
		<!-- 引入fileinput的css -->
		<link type="text/css" rel="stylesheet" href="Js/js/fileinput/css/fileinput.min.css" />
		
		<!-- 引入my97 -->
		<script type="text/javascript" src="Js/js/my97/WdatePicker.js"></script>
		<link href="Css/layout.css" rel="stylesheet" type="text/css">
		<link href="Css/login.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="Js/js/jquery.min.js"></script>
		<script type="text/javascript" src="Js/js.js"></script>
		<script type="text/javascript" src="Js/jquery.cookie.js"></script>
		<!-- 引入bootstrap的js-->
		<script type="text/javascript" src="Js/js/bootstrap/js/bootstrap.min.js"></script>
		<!-- 引入bootstrap的js-->
		<script type="text/javascript" src="Js/js/treeview/bootstrap-treeview.min.js"></script>
		<!-- 引入bootstrap的js-->
		<script type="text/javascript" src="Js/js/addTabs/addTabs.js"></script>
		<!-- 引入bootstrap-table的js-->
		<script type="text/javascript" src="Js/js/table/bootstrap-table.min.js"></script>
		<script type="text/javascript" src="Js/js/table/locale/bootstrap-table-zh-CN.min.js"></script>
		<!-- 引入bootbox.js -->
		<script type="text/javascript" src="Js/js/bootbox/bootbox.js"></script>

	</head>

	<body class="login-bg">
		<div style="border:1px solid #99aaff;height:4%;width:100%"><div><center><font color="ddddff"><h5>金科创想，放飞梦想</h5></font></center></div></div>
		<!--登录-->
		<div class="main" height="100%">
			<div class="logo text-center" id="regImg">
				<a href="#">
					<img src="Images\JK-logo2.png" width="200px" height="180px">
				</a>
			</div>
			<div class="login-dom" id="reg1">
				<!--注册-->
				<form class="register-form" name="register" autocomplete="off">
					<div class="reg-wrap border" id="phoneOne">
						<div class="reg-number border-bottom">
							<div class="fl reg-area text-gray">+86</div>
							<input type="text" class="fl reg-phone" name="mobile" id="mobile" placeholder="请输入手机号码"/>
						</div>
						<div class="reg-number">
							<input type="text" disabled="disabled" name="vcode" id="vcode" class="fl padding-big-left reg-code" placeholder="请输入验证码" />
							<a href="#" class="fl reg-send" id="send">发送验证码</a>
						</div>
					</div>
					<div class="reg-wrap border" id="emailOne" style="display: none">
						<div class="reg-number border-bottom">
							<div class="fl reg-area text-gray">email</div>
							<input type="text" class="fl reg-phone" id="userEmail" placeholder="请输入邮箱"/>
						</div>
						<div class="vcodeEmail">
							<input type="text" disabled="disabled" id="vcodeEmail" class="fl padding-big-left reg-code" placeholder="请输入验证码" />
							<a href="javaScript:emailMsg()" class="fl reg-send" id="sendEmail">发送验证码</a>
						</div>
					</div>
					<input type="hidden" name="formhash" value="5abb5d21" />
					<div class="margin-large-top padding-big-top">
						<input type="button" id="pageOne" class="btn text-big" value="下一页">
					</div>
					<!-- <div class="reg-btn text-center text-big logo-color" type="submit">立即注册</div> -->
				</form>
				<div class="forget">
					<a href="#" id="emailRegister" class="forget-pwd text-small fl">注册邮箱账号</a>
					<a href="#" id="phoneRegister" class="forget-pwd text-small fl" style="display:none;">注册手机账号</a>
					<a href="Jk-Pay.html" class="forget-new text-small fr" id="forger-login">已有账号，立即登录</a>
				</div>
			</div>

			<!--第二页-->
		<div class="main" id="reg2" style="display:none">
			<div style="border:1px solid #ffffff;width:800px;height:950px;" class="container-fluid">
				<div class="row">
					<div class="col-md-12">
						<div class="text-centers">
							<a href="#">
								<img src="Images/log1-1.PNG" width="400px" height="120px">
							</a>
						</div>
					</div>
					<div class="col-md-12">
						<form id="form1" class="form-horizontal">
							<div class="form-group">
								<label for="useraccountx" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">易付宝账户名</font></label>
								<div class="col-md-6 col-sm-6">
								  <span id="useraccountx"></span>
								</div>
							</div>
							<div class="form-group">
								<div class="col-md-3 col-xs-3 control-label">
									<font color="#ffff9b" size="5">设置登录密码</font>
								</div>
							</div>
							<div class="form-group">
								<label for="userpwd1" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">登录密码</font></label>
								<div class="col-md-6 col-sm-6">
								  <input type="password" class="form-control"onblur="pwd()" id="userpwd1" placeholder="Password">
								</div><span id="pwd1"></span>
							</div>
							<div class="form-group">
								<label for="userpwd2" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">在输入一次</font></label>
								<div class="col-md-6 col-sm-6">
								  <input type="password" class="form-control" id="userpwd2" onblur="pwd1()" placeholder="Password">
								</div><span id="pwd2"></span>
							</div>
							<div class="form-group">
								<div class="col-md-3 col-xs-3 control-label">
									<font color="#ffff9b" size="5">设置支付密码</font>
								</div>
							</div>
							<div class="form-group">
								<label for="paymentpwd1" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">支付密码</font></label>
								<div class="col-md-6 col-sm-6">
								  <input type="password" class="form-control" onblur="ppwd()" maxlength="6" id="paymentpwd1" placeholder="PaymentPassword">
								</div><span id="paypwd1"></span>
							</div>
							<div class="form-group">
								<label for="paymentpwd2" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">在输入一次</font></label>
								<div class="col-md-6 col-sm-6">
								  <input type="password" class="form-control" onblur="ppwd1()" maxlength="6" id="paymentpwd2" placeholder="PaymentPassword">
								</div><span id="paypwd2"></span>
							</div>
							<div class="form-group">
								<div class="col-md-3 col-xs-3 control-label">
									<font color="#ffff9b" size="5">设置身份信息</font>
								</div>
							</div>
							<div class="form-group">
								<label for="username" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">真实姓名</font></label>
								<div class="col-md-6 col-sm-6">
								  <input type="text" class="form-control" onblur="zname()" id="username" placeholder="UserName">
								</div><span id="uname"></span>
							</div>
							<div class="form-group">
								<label for="sex" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">性别</font></label>
								<div class="radio">
								  <label>&nbsp;&nbsp;&nbsp;
									<input type="radio" name="usersexx" id="sex" value="1" checked>
									男
								  </label>
								  <label>
									<input type="radio" name="usersexx" value="0"><span id="usex"></span>
									女
								  </label>
								</div>
							</div>
							<div class="form-group">
								<label for="identitycard" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">身份证号码</font></label>
								<div class="col-md-6 col-sm-6">
								  <input type="text" class="form-control" onblur="sfzz()" id="identitycard" placeholder="IdentityCard">
								</div><span id="uauth"></span>
							</div>
							<div class="form-group">
								<label for="yxq" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">有效期</font></label>
								<div class="col-md-5 col-sm-5">
								  <input  class="form-control Wdate" style="height:35px;width:300px" onblur="yxqCheck()" type="text" id="yxq"  onClick="WdatePicker()">
								</div>
								<input type="checkbox" value="1" id="cq">长期<span id="udate"></span>
							</div>
							<div class="form-group">
								<label for="profession" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">职业</font></label>
								<div class="col-md-6 col-sm-6">
									<select style="width:300px;height:35px;border-radius:5px;" id="profession"><option value="0">--请选择--</option></select>
								</div><span id="upro"></span>
							</div>
							<div class="form-group">
								<label for="sheng" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">常用地址</font></label>
								<div class="col-md-6 col-sm-6">
									<select style="width:100px;height:35px;border-radius:5px;" name="addresss" id="sheng"><option value="0">--请选择--</option></select>
									<select style="width:100px;height:35px;border-radius:5px;" name="addresss" id="shi"><option value="0">--请选择--</option></select>
									<select style="width:100px;height:35px;border-radius:5px;" name="addresss" id="xian"><option value="0">--请选择--</option></select><span id="uadd"></span>
								  <textarea class="form-control" onblur="textBox()" id="addressmarkx" rows="3"></textarea><span id="uaddm"></span>
								</div>
								<br/><br/><br/>
								<div class="margin-large-top padding-big-top">
									<input type="button" id="pageTwo" class="btn text-big" value="下一页">
								</div>
							</div>
							<div class="form-group">
								<div class="col-md-6 col-sm-6">
								  Copyright 2013-2016 金科创想 版权所有 <a href="#" target="_blank">京ICP备13005806号</a>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!--第三页-->
		<div class="main" id="reg3" style="display:none">
			<br/><br/><br/><br/><br/><br/>
			<div style="border:0px solid #ffff9b;width:800px;height:500px;" class="container-fluid">
			<div class="row">
				<div class="col-md-12 col-xs-12">
						<!--注册-->
						<form class="form-horizontal" name="register" autocomplete="off">
							<div class="form-group">
								<label for="bankCardNo" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">银行卡号</font></label>
								<div class="col-md-6 col-sm-6">
								  <input type="text" class="form-control" id="bankCardNo" placeholder="请输入正确的银行卡号">
								</div><span id="bnum"></span>
							</div>
							<div class="form-group">
								<label for="name" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">持卡人姓名</font></label>
								<div class="col-md-6 col-sm-6">
								  <input type="text" class="form-control" id="name" readonly="readonly" placeholder="Password">
								</div>
							</div>
							<div class="form-group">
								<label for="zhengjian" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">证件</font></label>
								<div class="col-md-2 col-sm-2">
								  <select style="width:110px;height:25px;border-radius:5px;" id="zhengjian"><option value="1">身份证</option></select>
								</div>
								<div class="col-md-4 col-sm-4">
								  <input type="text" readonly="readonly" id="displaySfz" class="form-control" placeholder="Password">
								</div>
							</div>
							<div class="form-group">
								<label for="bankPhone" class="col-md-2 col-sm-2 control-label"><font color="#ccccff">验证码</font></label>
								<div class="col-md-3 col-sm-3">
								  <input type="text" class="form-control" disabled="disabled" id="bankPhone" placeholder="验证码">
								</div>
								<div class="col-md-2 col-sm-2">
									<input type="button" id="send1" class="btn-sm text-big" style="background:#eeeeff" value="发送验证码">
								</div>
							</div>
							<!--底部信息-->
							<div class="margin-large-top padding-big-top">
								<input type="button" id="registerOk" class="btn text-big" value="确认注册">
							</div>
							<!-- <div class="reg-btn text-center text-big logo-color" type="submit">立即注册</div> -->
						</form>
					<div>
						<div class="forget">
							<a href="repassword.html" class="forget-pwd text-small fl">忘记登录密码？</a>
							<a href="login.html" class="forget-new text-small fr" id="forger-login1">已有账号，立即登录</a>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="popupDom">
			<div class="popup  text-default">
			</div>
		</div>
		<div style="display:none">
			<form id="userRegister">
				<input type="text" name="useraccount" id="useraccounta">
				<input type="text" name="useremail" id="useremaila">
				<input type="text" name="userpwd" id="userpwda">
				<input type="text" name="paymentpwd" id="paymentpwda">
				<input type="text" name="username" id="usernamea">
				<input type="text" name="usersex" id="usersexa">
				<input type="text" name="identitycard" id="identitycarda">
				<input type="text" name="datedeadine" id="datedeadinea">
				<input type="text" name="profession" id="professiona">
				<input type="text" name="address" id="addressa">
				<input type="text" name="addressmark" id="addressmarka">
				<input type="text" name="paperstype" id="paperstypea">
			</form>
		</div>
		<script type="text/javascript" src="Js/Validform_v5.3.2_min.js"></script>
		<script type="text/javascript">
			var xhr = new XMLHttpRequest();
			xhr.withCredentials = true;
			//使用邮箱注册
				$("#emailRegister").click(function (){
					$("#phoneOne").prop("style","display:none")
					$("#phoneRegister").prop("style","display:block")
					$("#emailOne").prop("style","display:block")
					$("#emailRegister").prop("style","display:none")
				})
			//使用手机注册
				$("#phoneRegister").click(function (){
					$("#phoneOne").prop("style","display:block")
					$("#phoneRegister").prop("style","display:none")
					$("#emailOne").prop("style","display:none")
					$("#emailRegister").prop("style","display:block")
				})
			//用户注册
			$("#registerOk").click(function (){
				$("#paperstypea").val($("#zhengjian").val())
				if($("#bankPhone").val() != null && $("#bankPhone").val() != ""){
				    if($("#bankPhone").val() == registerCode) {
                        $.ajax({
                            url: "http://localhost:8082/login?bankNum="+$("#bankCardNo").val(),
                            type: "POST",
                            data: $("#userRegister").serialize(),
                            dataType: "text",
                            success: function (data) {
                                alert(data)
                            },
                            error: function () {
                                alert("注册失败，请联系客服人员")
                            }
                            //xhrFields:{ withCredentials: true }//跨域请求参数是否携带cookie 跨域默认不会携带cookie
                        })
                    }else{
				        alert("请输入正确的验证码")
					}
				}else{
					alert("请输入验证码")
				}
			})
			//注册验证码
			var registerCode = "";
			//相关全局字段
			var yxqTest = false;var cq = false;var pwdd = false;var paypwd = false;var znamee = false;var sfz = false;var textBoxx = false;var status1 = false;
			//点击第二页下一页进入第三页
			var xianTest = "";
			$("#pageTwo").click(function (){
				var upro = false;
				if($("#profession").val() != "0"){upro = true;}else{$("#upro").html("请选择职业")}
				if($("#shi").val() != "0"){
					if(xianTest != "" && xianTest != null && $("#xian").val() != "0"){
						status1 = true;
						$("#addressa").val($("#sheng").val()+"-"+$("#shi").val()+"-"+$("#xian").val())
					}else if(xianTest == null || xianTest == ""){
						status1 = true;
						$("#addressa").val($("#sheng").val()+"-"+$("#shi").val())
					}else{
						status1 = false;
					}
				}
				if((yxqTest || cq) & pwdd & paypwd & znamee & sfz & textBoxx & upro & status1){
					$("#usersexa").val($("[name='usersexx']").val())
					$("#professiona").val($("#profession").val())
					$("#reg2").prop("style","display:none")
					$("#reg3").prop("style","display:block")
				}else{
					if(yxqTest == false && cq == false){$("#udate").html(redPsl+"请选择有效日期"+redPsr)}
					if(pwd == false){$("#pwd1").html(redPsl+"密码不能为空"+redPsr);$("#pwd2").html(redPsl+"密码不能为空"+redPsr)}
					if(paypwd == false){$("#paypwd1").html(redPsl+"支付密码不能为空"+redPsr);$("#paypwd2").html(redPsl+"支付密码不能为空"+redPsr)}
					if(zname == false){$("#uname").html(redPsl+"姓名不能为空"+redPsr)}
					if(sfz == false){$("#uauth").html(redPsl+"身份证号码不能为空"+redPsr)}
					if(textBox == false){$("#uaddm").html(redPsl+"常用地址不能为空"+redPsr)}
					if(upro == false){$("#upro").html(redPsl+"请选择职业")+redPsr}
					if(status1 == false){$("#uadd").html(redPsl+"请选择地区"+redPsl)}
				}
			})
			
			var redPsl = "<font color='#ff0000'>";
			var redPsr = "</font>";
			var secc = "<font color='#00ff00'>√</font>";
			//正则
			//验证登录密码
			function pwd(){
				var pwdRegex = /^\w{6,12}$/;
				if($("#userpwd1").val()==null || $("#userpwd1").val()==""){
					$("#pwd1").html(redPsl+"密码不能为空"+redPsr)
				}else{
					if(pwdRegex.test($("#userpwd1").val())){
						$("#pwd1").html(secc)
					}else{
						$("#pwd1").html(redPsl+"密码格式为6-12位的字母+数字+下划线组合!"+redPsr)
					}
				}
			}
			function pwd1(){
				var pwdRegex = /^\w{6,12}$/;
				if($("#userpwd2").val() == null || $("#userpwd2").val() == ""){
					$("#pwd2").html(redPsl+"密码不能为空"+redPsr)
				}else{
					if(pwdRegex.test($("#userpwd2").val())){
						if($("#userpwd2").val() == $("#userpwd1").val()){
							$("#pwd2").html(secc)
							$("#pwd1").html(secc)
							pwdd = true;
							$("#userpwda").val($("#userpwd2").val())
						}else{
							$("#pwd2").html(redPsl+"两次密码不一致"+redPsr)
						}
					}else{
						$("#pwd2").html(redPsl+"密码格式为6-12位的字母+数字+下划线组合!"+redPsr)
					}
				}
			}
			//验证支付密码
			var regex = /^\d{6}$/;
			function ppwd(){
				if($("#paymentpwd1").val()==null || $("#paymentpwd1").val()==""){
					$("#paypwd1").html(redPsl+"支付密码不能为空"+redPsr)
				}else{
					if(regex.test($("#paymentpwd1").val())){
						$("#paypwd1").html("")
					}else{
						$("#paypwd1").html(redPsl+"请输入正确的6位数字"+redPsr)
					}
				}
			}
			function ppwd1(){
				if($("#paymentpwd2").val() == null || $("#paymentpwd2").val() == ""){
					$("#paypwd2").html(redPsl+"支付密码不能为空"+redPsr)
				}else{
					if(regex.test($("#paymentpwd2").val())){
						if($("#paymentpwd2").val() == $("#paymentpwd1").val()){
							$("#paypwd1").html(secc)
							$("#paypwd2").html(secc)
							paypwd = true;
							$("#paymentpwda").val($("#paymentpwd2").val())
						}else{
							$("#paypwd2").html(redPsl+"两次支付密码不一致"+redPsr)
						}
					}else{
						$("#paypwd2").html(redPsl+"请输入正确的6位数字"+redPsr)
					}
				}
			}
			//验证真实姓名
			var realName = "";
			function zname(){
				if($("#username").val() == null || $("#username").val() == ""){
					$("#uname").html(redPsl+"姓名不能为空"+redPsr)
				}else{
					$("#uname").html(secc)
					znamee = true;
					$("#usernamea").val($("#username").val())
					realName = $("#username").val();
					var newName = realName.replace(realName.substring(0,1),"*");
					$("#name").prop("placeholder",newName);
				}
			}
			//验证身份证
			function sfzz(){
				var regex = /^\d{18}$/;
				if($("#identitycard").val() == null || $("#identitycard").val() == ""){
					$("#uauth").html(redPsl+"身份证号码不能为空"+redPsr)
				}else{
					if(regex.test($("#identitycard").val())){
						$("#uauth").html(secc)
						sfz = true;
						$("#identitycarda").val($("#identitycard").val())
						var disSfz = $("#identitycard").val().charAt(0);
						for(var i = 0;i<$("#identitycard").val().length;i++){
						    if(i > 0 && i < $("#identitycard").val().length-1){
						        disSfz += "*";
							}
						}
						disSfz += $("#identitycard").val().charAt($("#identitycard").val().length-1)
						$("#displaySfz").prop("placeholder",disSfz);
					}else{
						$("#uauth").html(redPsl+"请输入有效的18位身份证号"+redPsr)
					}
				}
			}
			//验证常用地址
			function textBox(){
				if($("#addressmarkx").val() == null || $("#addressmarkx").val() == ""){
					$("#uaddm").html(redPsl+"常用地址不能为空"+redPsr)
				}else{
					$("#uaddm").html(secc)
					textBoxx = true;
					$("#addressmarka").val($("#addressmarkx").val())
				}
			}
			//日期改变事件
			function yxqCheck(){
				if(($("#yxq").val() != null && $("#yxq").val() != "") || $("#cq").prop("checked")){
					$("#udate").html(secc)
					yxqTest = true;
					$("#datedeadinea").val($("#yxq").val())
				}else{
					$("#udate").html(redPsl+"请选择有效日期"+redPsr)
					yxqTest = false;;
				}
			}
			
			
			//点击长期后日期不可选
			$("#cq").click(function (){
				if($("#cq").prop("checked")){
					$("#yxq").prop("disabled","disabled")
					$("#udate").html(secc)
					cq = true;
					$("#datedeadinea").val("2099-12-31")
					$("#datedeadine").val(null)
				}else{
					$("#yxq").removeAttr("disabled")
					cq = false;
				}
			})
			//页面加载查询职业
			$(function (){
				$.ajax({
					url:"http://localhost:8082/reg/selProfession",
					type:"GET",
					//data:"",
					dataType:"json",
					success:function (data){
						var pro = "<option value='0'>--请选择--</option>";
						for(var i = 0 ; i < data.length ; i++){
							pro += "<option value='"+data[i].dictid+"'>"+data[i].dictinfo+"</option>";
						}
						$("#profession").html(pro);
					},
					error:function (){
						alert("职业查询失败")
					}
				})
			})
			//内容改变查询县
			$("#shi").change(function(){
				$.ajax({
					url:"http://localhost:8082/reg/selSSS",
					type:"GET",
					data:{"id":$("#shi").val()},
					dataType:"json",
					success:function (data){
						xianTest = data;
						if(data != null && data != ""){
							$("#xian").show();
							var xianInfo = "<option value='0'>--请选择--</option>";
							for(var i = 0 ; i < data.length ; i++){
								xianInfo += "<option value='"+data[i].id+"'>"+data[i].name+"</option>";
							}
							$("#xian").html(xianInfo);
						}else{
							$("#xian").hide();
						}
					},
					error:function (){
						alert("县查询失败")
					}
				})
			})
			//内容改变查询市与县
			$("#sheng").change(function(){
				$("#xian").html("<option value='0'>--请选择--</option>");
				$.ajax({
					url:"http://localhost:8082/reg/selSSS",
					type:"GET",
					data:{"id":$("#sheng").val()},
					dataType:"json",
					success:function (data){
						var shiInfo = "<option value='0'>--请选择--</option>";
						for(var i = 0 ; i < data.length ; i++){
							shiInfo += "<option value='"+data[i].id+"'>"+data[i].name+"</option>";
						}
						$("#shi").html(shiInfo);
					},
					error:function (){
						alert("市查询失败")
					}
				})
			})
			//页面加载查询省
			$(function (){
				$.ajax({
					url:"http://localhost:8082/reg/selSSS",
					type:"GET",
					//data:{"id":$("#sheng").val()},
					dataType:"json",
					async:false,
					success:function (data){
						var shengInfo = "<option value='0'>--请选择--</option>";
						for(var i = 0 ; i < data.length ; i++){
							shengInfo += "<option value='"+data[i].id+"'>"+data[i].name+"</option>";
						}
						$("#sheng").html(shengInfo);
					},
					error:function (){
						alert("省查询失败")
					}
				})
			})
			//验证码，用来判断是否进入下一页
			var authCode = null;var useraccount = null;
			//点击下一页进入第二页
			$("#pageOne").click(function (){
				if($("#vcode").val() == authCode || $("#vcodeEmail").val() == authCode){
					$("#reg1").prop("style","display:none");
					$("#regImg").prop("style","display:none");
					$("#reg2").prop("style","display:block")
					$("#useraccountx").html("<font color='ccccff'>"+useraccount+"</font>")

				}else{
					alert("验证码错误")
				}
			})
			//查询用户手机号是否重复
			var checkUserPhoneStatus = false;
			$("#mobile").blur(function (){
			    if($("#mobile").val() != null && $("#mobile").val() != "") {
                    $.ajax({
                        url: "http://localhost:8082/reg",
                        type: "GET",
                        data: {"useraccount": $("#mobile").val()},
                        dataType: "json",
                        success: function (data) {
                            if (data.flag == 0) {
                                //用户手机号不重复
                                checkUserPhoneStatus = true;
                            } else {
                                //用户手机号重复给与提示
                                checkUserPhoneStatus = false;
                                alert("手机号重复,请修改")
                            }
                        },
                        error: function () {
                            alert("手机验重失败，请联系客服人员;")
                        }
                    })
                }else{
					alert("请输入手机号")
				}
			})
			/*动画（注册）*/
			$(document).ready(function(e) {
				var register = [];

				/*仿刷新：检测是否存在cookie*/
				/*
				$mobile = '';
				$time = 0;
				if (register) {
					$time = parseInt(new Date().getTime() / 1000 - register.time);
					$("input[name=mobile]").attr('value', register.mobile);
					_status($time);
				}
				$("input[name=mobile]").focus();
				*/

				$('form[name=register]').Validform({
					ajaxPost: true,
					tiptype: function(msg) {
						if (msg) popup('' + msg + '');
					},
					callback: function(ret) {
						popup('' + ret.info + '');
						if (ret.status == 1) {
							if (ret.uc_user_synlogin) {
								$("body").append(ret.uc_user_synlogin);
							}
							window.location.href = ret.url;
						}
					}
				})
			});

			/*发送手机注册验证码*/
			$("#send").click(function() {
				var obj = $("input[name=mobile]");
				if (obj.val() == "") {
					popup("请输入手机号码")
					obj.focus();
					return false;
				}
				if(checkUserPhoneStatus) {
                    $.ajax({
                        url: "http://localhost:8082/login/shortMessageAuthCode",
                        type: "GET",
                        data: {"useraccount": $("#mobile").val()},
                        dataType: "json",
                        success: function (data) {
                            authCode = data.code;
                            useraccount = data.phone;
                            $("#useraccount").val(useraccount)
                            $("#useraccounta").val(useraccount)
                            $("input[name=vcode]").removeAttr('disabled');
                            _status(60);
                        },
                        error: function () {
                            alert("验证码获取失败")
                        }
                    })
                }else{
                    alert("手机号重复,请修改")
				}
			});
			function _status(count) {
				var $send_sms = $("#send");
				var count = count;
				$send_sms.attr('disabled', 'disabled');
				var resend = setInterval(function() {
					count--;
					if (count > 0) {
						$('#send').html(count + '秒后重试');
						$("input[name='vcode']").removeAttr('disabled');
						$.cookie("register_vcode", count, {
							path: '/',
							expires: (1 / 86400) * count
						});

					} else {
						clearInterval(resend);
						$send_sms.html("重获验证码").removeAttr('disabled');
						$.cookie("register_vcode", null);
					}
				}, 1000);
			}
			
			
			/*发送银行预留手机验证码*/
			$("#send1").click(function() {
				var obj = $("#bankCardNo");
				if (obj.val() == "") {
					popup("请输入手机号码")
					obj.focus();
					return false;
				}
				$.ajax({
					url:"http://localhost:8082/reg/bankShortMessage",
					type:"GET",
					data:{"banknum":$("#bankCardNo").val()},
					dataType:"json",
					success:function (data){
						registerCode = data.code;
						$("#useraccount").val(data.useraccount)
						$("#bankPhone").removeAttr('disabled');
						_status1(60);
					},
					error:function (){
						alert("验证码获取失败")
					}
				})
			});
			function _status1(count) {
				var $send_sms = $("#send1");
				var count = count;
				$send_sms.attr('disabled', 'disabled');
				var resend = setInterval(function() {
					count--;
					if (count > 0) {
						$('#send1').html(count + '秒后重试');
						$("bankPhone").removeAttr('disabled');
						$.cookie("register_vcode", count, {
							path: '/',
							expires: (1 / 86400) * count
						});

					} else {
						clearInterval(resend);
						$send_sms.html("重获验证码").removeAttr('disabled');
						$.cookie("register_vcode", null);
					}
				}, 1000);
			}

            /*发送邮箱验证码*/
          //  $("#sendEmail").click(function() {
			function emailMsg(){
                var obj = $("#userEmail");
                if (obj.val() == "") {
                    alert("请输入有效邮箱")
                    return false;
                }
                $.ajax({
                    url:"http://localhost:8082/login/getEmailInfo",
                    type:"GET",
                    data:{"useremail":$("#userEmail").val()},
                    dataType:"json",
                    success:function (data){
                        authCode = data.code;
                        useraccount = data.useremail;
                        $("#useremaila").val(data.useremail)
                        $("#vcodeEmail").removeAttr('disabled');
                        _status1(60);
                    },
                    error:function (){
                        alert("验证码获取失败")
                    }
                })
            };
            function _status1(count) {
                var $send_sms = $("#sendEmail");
                var count = count;
                $send_sms.attr('disabled', 'disabled');
                var resend = setInterval(function() {
                    count--;
                    if (count > 0) {
                        $('#sendEmail').html(count + '秒后重试');
                        $("#vcodeEmail").removeAttr('disabled');
                        $.cookie("register_vcode", count, {
                            path: '/',
                            expires: (1 / 86400) * count
                        });

                    } else {
                        clearInterval(resend);
                        $send_sms.html("重获验证码").removeAttr('disabled');
                        $.cookie("register_vcode", null);
                    }
                }, 1000);
            }
		</script>
	</body>

</html>